﻿<Window x:Class="Lithnet.Transforms.Presentation.NewItemWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:core="clr-namespace:Lithnet.Common.Presentation;assembly=Lithnet.Common.Presentation"
        xmlns:t="clr-namespace:Lithnet.Transforms;assembly=Lithnet.Transforms"
        xmlns:p="clr-namespace:Lithnet.Transforms.Presentation"
        Title="Create New Item"
        Height="200"
        Width="300"
        ResizeMode="NoResize"
        ShowInTaskbar="False"
        Topmost="True"
        WindowStartupLocation="CenterOwner"
        Icon="Resources/transform.png">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition />
            <RowDefinition />
        </Grid.RowDefinitions>
        <StackPanel Grid.Row="0">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition />
                    <RowDefinition />
                </Grid.RowDefinitions>
                <Grid.Margin>
                    <Thickness>15</Thickness>
                </Grid.Margin>
                
                <Label Content="Type"
                       Grid.Row="0"
                       Grid.Column="0" />
                <ComboBox ItemsSource="{Binding Source={p:TransformTypeMarkupExtension {x:Type t:Transform}}}"
                          SelectedValue="{Binding TransformType,ValidatesOnDataErrors=True}"
                          SelectedValuePath="Value"
                          Grid.Row="0"
                          Grid.Column="1"
                          Width="Auto"
                          MinWidth="200" />

                <Label Content="ID"
                       Grid.Row="1"
                       Grid.Column="0" />
                <TextBox Grid.Row="1"
                         Grid.Column="2"
                         Text="{Binding Id, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=true}" />
            </Grid>
        </StackPanel>

        <!--<ContentPresenter Grid.Row="1" DataContext="{Binding NewTransform}">
            <ContentPresenter.Resources>
                <ResourceDictionary Source="/Views/ResourceDictionaries/TransformViewDictionary.xaml" />
            </ContentPresenter.Resources>
        </ContentPresenter>-->

        <StackPanel Grid.Row="2"
                    Orientation="Horizontal"
                    HorizontalAlignment="Right"
                    VerticalAlignment="Bottom"
                    Height="37"
                    Width="120">
            <Button Content="OK"
                    MinWidth="50"
                    MinHeight="27"
                    Margin="5"
                    Command="{Binding Commands.Create}"
                    IsDefault="True" />
            <Button Content="Cancel"
                    Margin="5"
                    MinWidth="50"
                    MinHeight="27"
                    IsCancel="True" />
        </StackPanel>
    </Grid>
</Window>
